/**
 * 题目链接：2025/10/28 考试 T4 操作
 * 完成时间：2025/10/28 17:05
 * 简要思路：
 */
#include <bits/stdc++.h>
#define range(i, b, e) for (auto i(b); i != (e); i++)
#define rep(i, b, e) for (auto i(b); i <= (e); i++)
#define req(i, b, e) for (auto i(b); i >= (e); i--)
using namespace std;
typedef long long LL;
typedef pair<int, int> Pii;

const int N = 1e5, mod = 1e9+7;
LL x, y;
int dp[N+5];

int main() {
	freopen("op.in", "r", stdin);
	freopen("op.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	cin >> x >> y;
	if (y <= 1e5) {
		dp[y] = 1;
		req(i, y-1, x) {
			dp[i] = dp[i+1];
			if (i*2 <= y) dp[i] = (dp[i] + dp[i*2]) % mod;
		}
		cout << dp[x];
	}
	else cout << 1;
	return 0;
}
